import java.util.Random;

/*
 * This class is responsible for reading the incoming feed from the DCS power meter
 * system. It is also responsible for updating the SPS object,so that the program has
 * an updated knowledge about the power usage of the servers/clusters.
 */

public class PowerFeedReader implements Runnable
{
	private SystemPowerState SPS = null;
	
	public PowerFeedReader(SystemPowerState SPS) 
	{
		this.SPS= SPS;
	}
	
	public void run()
	{
		
	}
	
	private void readFeed()
	{
		// code to interpret the feed and analyse the individual power usage
		
		updatePowerState(5);
	}
	
	private void updatePowerState(int n)
	{
		for(int i=0;i<n;i++)
		{
			Random tempNumber = new Random();
			SPS.setValue(i,tempNumber.nextDouble()*10);
		}
	}
}
